package com.gas.project.gas.morality.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gas.framework.aspectj.lang.annotation.Excel;
import com.gas.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 奖惩信息对象 gas_morality
 *
 * @author xyl
 * @date 2022-04-04
 */
public class Morality extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 品德id
     */
    private Long moralityId;

    /**
     * 内容
     */
    @Excel(name = "内容")
    private String content;

    /**
     * 等级
     */
    @Excel(name = "等级（院级，校级等）")
    private String moralityLevel;

    /**
     * 获得时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "获得时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date obtainTime;

    /**
     * 学年
     */
    @Excel(name = "学年")
    private Integer startTime;

    /**
     * 学期
     */
    @Excel(name = "学期")
    private String semester;

    /**
     * 学分
     */
    @Excel(name = "学分")
    private BigDecimal credit;

    /**
     * 学生学号
     */
    @Excel(name = "学生学号 ")
    private String studentNumber;

    private String myStudent;

    private String studentName;

    private String teacherNumber;

    private String teacherName;

    private boolean reply;

    public boolean isReply() {
        return reply;
    }

    public void setReply(boolean reply) {
        this.reply = reply;
    }

    public String getTeacherNumber() {
        return teacherNumber;
    }

    public void setTeacherNumber(String teacherNumber) {
        this.teacherNumber = teacherNumber;
    }

    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    public String getStudentName() {

        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    public String getMyStudent() {
        return myStudent;
    }

    public void setMyStudent(String myStudent) {
        this.myStudent = myStudent;
    }

    public void setMoralityId(Long moralityId) {
        this.moralityId = moralityId;
    }

    public Long getMoralityId() {
        return moralityId;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContent() {
        return content;
    }

    public void setMoralityLevel(String moralityLevel) {
        this.moralityLevel = moralityLevel;
    }

    public String getMoralityLevel() {
        return moralityLevel;
    }

    public void setObtainTime(Date obtainTime) {
        this.obtainTime = obtainTime;
    }

    public Date getObtainTime() {
        return obtainTime;
    }

    public void setStartTime(Integer startTime) {
        this.startTime = startTime;
    }

    public Integer getStartTime() {
        return startTime;
    }

    public void setSemester(String semester) {
        this.semester = semester;
    }

    public String getSemester() {
        return semester;
    }

    public void setCredit(BigDecimal credit) {
        this.credit = credit;
    }

    public BigDecimal getCredit() {
        return credit;
    }

    public void setStudentNumber(String studentNumber) {
        this.studentNumber = studentNumber;
    }

    public String getStudentNumber() {
        return studentNumber;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("moralityId", getMoralityId())
                .append("content", getContent())
                .append("moralityLevel", getMoralityLevel())
                .append("obtainTime", getObtainTime())
                .append("startTime", getStartTime())
                .append("semester", getSemester())
                .append("credit", getCredit())
                .append("studentNumber", getStudentNumber())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .append("remark", getRemark())
                .toString();
    }

    public String check(Morality morality) {
        if (StringUtils.isBlank(morality.getStudentNumber())) {
            return "学生学号不能为空！";
        }
        if (StringUtils.isBlank(morality.getContent())) {
            return "奖惩内容不能为空！";
        }
        if (StringUtils.isBlank(morality.getMoralityLevel())) {
            return "奖惩（院级，校级等）不能为空！";
        }
        if (StringUtils.isBlank(morality.getSemester())) {
            return "学期不能为空";
        }
        if (morality.getCredit() == null) {
            return "学分不能为空！";
        }
        if (morality.getObtainTime() == null) {
            return "获得实践不能为空！";
        }
        if (morality.getStartTime() == null) {
            return "学年不能为空！";
        }
        return null;
    }
}
